package com.baidu.bulls.cat.demo.account.catutils;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class CatFilterConfiguration {

    @Bean
    public FilterRegistrationBean catFilter(){
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
        CatServletFilter filter = new CatServletFilter();
        filterRegistrationBean.setFilter(filter);
        filterRegistrationBean.addUrlPatterns("/*");
        filterRegistrationBean.setName("cat-filter");
        filterRegistrationBean.setOrder(1);

        return filterRegistrationBean;

    }

}
